#!/bin/bash
wget rz.muc.edu.cn/srun_portal_pc_success.php>/dev/null 2>&1
ip=$(cat srun_portal_pc_success.php |grep user_ip|sed 's/.*value="//'|sed 's/".*//')
username=$(cat srun_portal_pc_success.php |grep username|sed 's/.*value="//'|sed 's/".*//')
rm -f srun_portal_pc_success.php*
if [ -z "$username" ]
then
	echo "Not logged!"	
else
	curl -d "action=auto_logout&ac_id=0&info=&user_ip=$ip&username=$username" "rz.muc.edu.cn/srun_portal_pc_success.php">/dev/null 2>&1
	echo "Logged out successfully!"
fi
